<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/static/jquery-3.3.1/jquery-3.3.1.min.js"></script>
    <style>
        button {
            width: 120px;
            height: 40px;
            border: 0;
            background-color: red;
            color: white;
            margin: 10px 0 0 10px;
        }
    </style>
</head>
<body>
支付金额：{{ num }}<br/>
{% if status == 1 %}
    <a href="{{ url_for('order.pay_success') }}?{{ kw }}" hidden>
        <span class="pay">支付</span>
    </a>
{% else %}
    <a href="{{ url_for('order.pay_success') }}?order_id={{ order_id }}" hidden>
        <span class="pay">支付</span>
    </a>
{% endif %}

<button onclick="pay_click()">立即支付</button>
</body>
<script>
    function pay_click() {
        $('.pay').click()
    }
</script>
</html>